Current Location: Home> Function Categories> date_timezone_get

date_timezone_get

Alias ​​for DateTime::getTimezone - Returns the time zone relative to the given date and time
Name:date_timezone_get
Category:Date and time
Programming Language:php
One-line Description:Returns the time zone of the given DateTime object.

Definition and usage

The date_timezone_get() function returns the time zone of the given DateTime object.

Example

Returns the time zone of the given DateTime object:

 <?php
$date = date_create ( null , timezone_open ( "Europe/Paris" ) ) ;
$tz = date_timezone_get ( $date ) ;
echo timezone_name_get ( $tz ) ;
?>

Try it yourself

grammar

 date_timezone_get ( object ) ;
parameter describe
object Required. Specifies the DateTime object returned by date_create() .
Similar Functions